Skip to content

fix: clear cache timeouts - #495

Merged
tannerlinsley merged 2 commits into
TanStack:masterfrom
team-griffin:fix/clear-cache-timeouts
May 17, 2020
Merged

tannerlinsley merged 2 commits into
TanStack:masterfrom
team-griffin:fix/clear-cache-timeouts

Conversation

@jackmellis

Copy link
Copy Markdown
Contributor

calling queryCache.clear() was empting the queries object but not tearing any of them down
this commit adds a clear method to the individual queries, which cancels timeouts and promises
queryCache.clear now loops through the queries and clears each one
I've also update the return type of queryCache.clear as it doesn't actually return anything

I've not added any tests as this is a very intermittent problem and I wasn't entirely sure if I could reliably reproduce the warnings. All existing tests still pass

this should solve #432 and unblock #476

Comment thread src/queryCache.js Resolved
Jack Ellis added 2 commits May 16, 2020 07:26
calling queryCache.clear() was empting the queries object but not tearing any of them down
this commit adds a clear method to the individual queries, which cancels timeouts and promises
queryCache.clear now loops through the queries and clears each one
I've also update the return type of queryCache.clear as it doesn't actually return anything
@jackmellis
jackmellis force-pushed the fix/clear-cache-timeouts branch from 8254bd8 to 47628eb Compare May 16, 2020 06:33
@jackmellis
jackmellis requested a review from tannerlinsley May 16, 2020 06:36
@tannerlinsley
tannerlinsley merged commit f76c860 into TanStack:master May 17, 2020
@tannerlinsley

Copy link
Copy Markdown
Member

Nice work!

@tannerlinsley

Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nx-cloud

nx-cloud Bot commented Sep 30, 2025 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 47628eb

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 58s View ↗
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-21 07:58:56 UTC

GEREGUR pushed a commit to GEREGUR/query that referenced this pull request Feb 17, 2026
TanStack#495)

Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants